package com.itheima.stock.controller.v1;

import com.itheima.stock.api.StockControllerAPI;
import com.itheima.stock.entity.StockBusiness;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.service.StockService;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: StockController
 * Package: com.itheima.stock.controller.v1
 * Description:
 *
 * @Author Lee
 * @Create 2024/10/30
 */
@RestController
public class StockController implements StockControllerAPI {

    private final StockService stockService;

    public StockController(StockService stockService) {
        this.stockService = stockService;
    }

    @Override
    public ResponseResult<List<StockBusiness>> getStockBusiness() {
        List<StockBusiness> stockBusinesses = stockService.getStockBusiness();
        return ResponseResult.ok(stockBusinesses);
    }
}
